<%@ page import="java.sql.ResultSet" %>
<%@ page import="com.cn.entity.NewsInfo" %>
<%@ page import="com.cn.Dao.NewsinfoDao" %>
<%--
  Created by IntelliJ IDEA.
  User: cza20
  Date: 2021/4/5
  Time: 10:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>报刊详情</title>
    <link rel="shortcut icon" href="<%=request.getContextPath()%>/img/logo2.png" type="image/x-icon">
</head>
<body>
<jsp:include page="index.html"/>
<jsp:include page="WEB-INF/header/header-user.jsp"/>
<%
    String num =request.getParameter("num");    //获取商品ID
    NewsInfo newsInfo = new NewsInfo();
    NewsinfoDao newsinfoDao = new NewsinfoDao();
    newsInfo = newsinfoDao.findByName(num);
    out.write("<div class='col-md-3' style='height:250px'>");
    out.write("<img src='ShowPicServlet?name="+num+"' width='170' height='170' style='display: inline-block;'>");
    out.write("</a>");
    out.write("<p><a style='color: green'>"+newsInfo.getName()+"</a></p>");
    out.write("<p><font color='#FF0000'>每月订阅价：¥"+newsInfo.getPrice()+"</font></p>");
    out.write("<p><font color='#FF0000'>报刊种类："+newsInfo.getType()+"</font></p>");
    out.write("<p><font color='#FF0000'>发行商："+newsInfo.getPub()+"</font></p>");
    out.write("<p><font color='#FF0000'>报刊编号："+num+"</font></p>");
    out.write("<p><font color='#FF0000'>发行频率："+newsInfo.getTerm()+"</font></p>");
    out.write("</div>");
    out.write("<div class='col-md-7' style='height:800px'>");
    out.write("<p><font color= black style=\"line-height:1.4;\">介绍："+newsInfo.getCon()+"</font></p>");
    String n1 = request.getContextPath()+"\\check_order.jsp";
    out.write("<form action="+n1+" method=\"get\">");
    out.write("<input type=\"hidden\" name=\"ID\" value="+newsInfo.getNum()+">");
    out.write("订阅份数: <input type=\"number\" name=\"copies\" min=\"1\" max=\"10\"  value=\"1\" />");
    out.write("<p>    </p>");
    out.write("订阅月数: <input type=\"number\" name=\"months\" min=\"1\" max=\"24\" value=\"1\" />");
    out.write("<p> <br /> </p>");
    out.write("<input type=\"submit\" value=\"订阅\"class=\"col-sm-12 btn btn-primary\"  />");
    out.write("</form>");
%>
<a href="#" style="float: right" onClick="javascript :history.back(-1) ;" >返回上一页</a>
</div>
</body>
</html>
